using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace VOL.Entity.DomainModels
{
    /// <summary>
    /// 部门级联显示DTO
    /// </summary>
    public class DepartmentCascadeDto
    {
        /// <summary>
        /// 部门ID
        /// </summary>
        public Guid DepartmentId { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string DepartmentName { get; set; }

        /// <summary>
        /// 部门编号
        /// </summary>
        public string DepartmentCode { get; set; }

        /// <summary>
        /// 上级部门ID
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 部门类型
        /// </summary>
        public string DepartmentType { get; set; }

        /// <summary>
        /// 是否可用
        /// </summary>
        public int? Enable { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 子部门列表
        /// </summary>
        public List<DepartmentCascadeDto> Children { get; set; } = new List<DepartmentCascadeDto>();

        /// <summary>
        /// 部门层级（用于显示缩进）
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 部门路径（从根部门到当前部门的完整路径）
        /// </summary>
        public string DepartmentPath { get; set; }
    }

    /// <summary>
    /// 部门查询参数DTO
    /// </summary>
    public class DepartmentSearchDto
    {
        /// <summary>
        /// 部门名称（模糊查询）
        /// </summary>
        public string DepartmentName { get; set; }

        /// <summary>
        /// 部门编号（模糊查询）
        /// </summary>
        public string DepartmentCode { get; set; }

        /// <summary>
        /// 是否只显示启用的部门
        /// </summary>
        public bool? OnlyEnabled { get; set; } = true;

        /// <summary>
        /// 是否返回树形结构（true：树形，false：平铺）
        /// </summary>
        public bool IsTreeStructure { get; set; } = true;

        /// <summary>
        /// 根部门ID（可选，用于获取指定部门下的子树）
        /// </summary>
        public Guid? RootDepartmentId { get; set; }
    }
}
